package com.example.demo.service;



import com.example.demo.mapper.OrdersBackMapper;
import com.example.demo.pojo.Catrgoryicon;
import com.example.demo.pojo.Order;
import com.example.demo.pojo.OrderParamaccepttijiao;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author yanglup
 * @create 2020-11-23 20:42
 */
@Service
public class OrdersBackServiceImpl implements OrdersBackService {
    @Autowired
    OrdersBackMapper ordersBackMapper;


    /**
     * 卖家全部订单
     */
    @Override
    public PageInfo<Order> BackOrderslist(Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<Order> mymycatrgoryicon= ordersBackMapper.BackOrderslist();
        PageInfo<Order> myPageInfo=new PageInfo<Order>(mymycatrgoryicon,pageSize);
        return myPageInfo;
    }
//    @Override
//    public List<Order> BackOrderslist() {
//        return ordersBackMapper.BackOrderslist();
//    }

    /**添加订单*/
    @Override
    public void createorderstableback(String openid, String openidbuy, String consignee_addr, Integer order_price,Integer goods_id, Integer goods_number,Integer goods_price, Integer order_status,String goods_name,String order_number,Integer buyer,Integer seller,String goods_small_logo) {
        ordersBackMapper.createorderstableback(openid,openidbuy,consignee_addr,order_price,goods_id,goods_number,goods_price,order_status,goods_name,order_number,buyer,seller,goods_small_logo);
    }

    /**修改时查询某商品*/
    @Override
    public OrderParamaccepttijiao selectorderParamaccepttijiao(Integer goods_id) {
        return ordersBackMapper.selectorderParamaccepttijiao(goods_id);
    }
    /**修改订单*/
    @Override
    public void updateorderstableback(Integer order_id,String openid, String openidbuy, String consignee_addr, Integer order_price,Integer goods_id, Integer goods_number,Integer goods_price, Integer order_status,String goods_name,String order_number,Integer buyer,Integer seller,String goods_small_logo) {
        ordersBackMapper.updateorderstableback(order_id,openid,openidbuy,consignee_addr,order_price,goods_id,goods_number,goods_price,order_status,goods_name,order_number,buyer,seller,goods_small_logo);
    }

    @Override
    public void Ordersdelete(Integer goods_id) {
        ordersBackMapper.Ordersdeleteback(goods_id);
    }


    /**所有订单数量*/
    @Override
    public Integer Ordersallnumber() {
        return ordersBackMapper.Ordersallnumber();
    }


    /**搜索图书名称*/
    @Override
    public List<Order> Ordersearch(String goods_name) {
        return ordersBackMapper.Ordersearch(goods_name);
    }
    /**搜索的图书的数量*/
    @Override
    public Integer Ordersearchnumber(String goods_name) {
        return ordersBackMapper.Ordersearchnumber(goods_name);
    }
}

